import app


class Kaihu_api():
    def __init__(self):
        self.kaihu_url=app.BASC_URL+"/trust/trust/register"
        self.get_recharge_code=app.BASC_URL+"/common/public/verifycode/{}"
        self.get_recharge_msg=app.BASC_URL+"/trust/trust/recharge"
    def kaihuapi(self,session):
        return session.post(self.kaihu_url)
    def get_recharge_code_api(self,session,r):
        url=self.get_recharge_code.format(r)
        res=session.get(url)
        return res
    def get_recharge_msg_api(self,session,amount,valicode='8888'):
        """定义充值方法"""
        form_data={"paymentType": "chinapnrTrust",
                     "formStr": "reForm",
                     "amount": amount,
                     "valicode": valicode}
        res=session.post(self.get_recharge_msg,data=form_data)
        return res



